<template>
  <div>
    <input v-model="inputVal" type="text" class="form-control" placeholder="请输入" />
    <button @click="handleSubmit">点我</button>
  </div>
</template>

<script setup>
import { ref } from 'vue';
const inputVal=ref('')
const props = defineProps({
    list:Array,
    default:()=>[]
})
const emits = defineEmits(['update:list'])


const handleSubmit=()=>{
    const arr = props.list
    arr.push(inputVal.value)
    emits('update:list',arr)
    inputVal.value=''
}





</script>

<style lang="scss" scoped>
</style>